package com.example.rabbitmqssl.controller;

import com.example.rabbitmqssl.service.ProducerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/")
public class IndexController {

    @Resource
    private ProducerService producerService;

    @GetMapping(value = "index")
    public String sendMessage(){
        producerService.produceMessage();
        return "消息已发送，请查看消息队列";
    }
}